As is known in the art, computers operate using a combination of hardware and software. The software controls how the computer hardware functions to produce a desired result. The software that is provided on a computer system includes an operating system and may include one or more software applications. The operating system controls the basic operations of the computer hardware and presents a framework for allowing other software applications to interface with the hardware. Known operating systems include the VMS operating system, MS DOS, Windows 95, Windows NT, or UNIX, among others.
Another software application that is often included in the software of the computer system is a compiler. The compiler is a software routine that translates software applications, written in a high level code such as C++, into an executable file capable of being run on the computer hardware. The executable file includes a set of instructions and data for implementing the software application on the computer hardware. The set of instructions comprises instructions from an instruction set of the computer. For example, a reduced instruction set computer (RISC) has an instruction set that includes simple operations, such as load and store operations. In general, the order of instructions in the executable file mirrors the order of instructions in the software application listing; with each instruction of the software application being translated into one or more corresponding instructions from the instruction set of the computer.
Once an executable file of the software application has been generated, the software application may be executed on the computer system. Generally, the executable file is stored in a memory of the computer system, such as main memory, disk drive or other such device. As the software application is executed, portions are moved from an external memory into a local memory referred to as a cache memory. The cache memory is a relatively fast memory that is used for temporary storage of instructions and data that are to be executed on a processor of the computer hardware. By providing fast access to the instructions and data, the cache memory helps to improve the performance of the software application by reducing the delay incurred when retrieving instructions and data from memory.
Each time that an instruction or data is required for operation of the software application, if the instruction or data is not stored in the cache it must be fetched from the memory. Because of the delays associated with retrieving data from memory, it is desirable to ensure that those instructions that are to be executed frequently are stored in the cache.
Optimization tools have been provided to improve the performance of software applications by re-arranging the order of instructions in the executable files to maximize cache usage. Re-arranging the order of the instructions in the executable files may be done to group together frequently executed instructions such that the group may be forwarded to the cache in one operation. Optimization tools may also re-arrange the order of instructions for a variety of other purposes.
One problem encountered by optimization tools is that the executable files provided by different compilers of different operating systems frequently have different formats. Some operating system compilers, such as the Windows NT compiler, interleave instructions and data to ensure that data that is needed by instructions is also moved to the cache when the associated instructions are moved to the cache. By placing data near the instructions, fewer cache accesses need to be made, fewer delays are incurred and the overall performance of applications is increased.
However, because the instructions and data are basically both multi-bit data words, when instructions and data are interleaved it is difficult for the optimization tool to identify which multi-bit data words are instructions capable of being re-arranged. Thus, it is often difficult to optimize executables generated by operating systems that interleave instructions and data.